package com.example.demo.controller;

import com.example.demo.pojo.ResultVo;
import com.example.demo.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @RequestMapping("send")
    public ResultVo send(String phone)throws Exception{
return loginService.sendCode(phone);
    }

    @RequestMapping("login")
    public ResultVo login(String phone,String code)throws Exception{
        return loginService.userLogin(phone,code);
    }

}
